import { Column, CreateDateColumn, Entity, PrimaryColumn } from 'typeorm';

@Entity()
export class Oauth2RegisteredClient {
  @PrimaryColumn({ type: 'varchar', length: 100 })
  id: string;

  @Column({
    type: 'varchar',
    length: 100,
    name: 'client_id'
  })
  clientId: string;

  @CreateDateColumn({
    type: 'timestamp',
    name: 'client_id_issued_at'
  })
  clientIdIssuedAt: Date;

  @Column({
    type: 'varchar',
    length: 200,
    name: 'client_secret',
    default: null
  })
  clientSecret: string;

  @Column({
    type: 'timestamp',
    name: 'client_secret_expires_at',
    default: null
  })
  clientSecretExpiresAt: Date;

  @Column({
    type: 'varchar',
    length: 200,
    name: 'client_name'
  })
  clientName: string;

  @Column({
    type: 'varchar',
    length: 1000,
    name: 'client_authentication_methods'
  })
  clientAuthenticationMethods: string;

  @Column({
    type: 'varchar',
    length: 1000,
    name: 'authorization_grant_types'
  })
  authorizationGrantTypes: string;

  @Column({
    type: 'varchar',
    length: 1000,
    name: 'redirect_uris',
    default: null
  })
  redirectUris: string;

  @Column({
    type: 'varchar',
    length: 1000,
    name: 'post_logout_redirect_uris',
    default: null
  })
  postLogoutRedirectUris: string;

  @Column({
    type: 'varchar',
    length: 1000
  })
  scopes: string;

  @Column({
    type: 'varchar',
    length: 1000,
    name: 'client_settings'
  })
  clientSettings: string;

  @Column({
    type: 'varchar',
    length: 2000,
    name: 'token_settings'
  })
  tokenSettings: string;
}
